/*
 * Copyright 2023-2024, Haiku Inc. All rights reserved.
 * Distributed under the terms of the MIT License.
 */

#include <arch/platform.h>
#include <boot/kernel_args.h>

#include <debug.h>

uint32 gPlatform;

void *gFDT = NULL;

status_t
arch_platform_init(struct kernel_args *args)
{
    gPlatform = args->arch_args.machine_platform;

    debug_early_boot_message("machine_platform: ");
    switch (gPlatform)
    {
    case kPlatformLoongson:
        debug_early_boot_message("Loongson\n");
        break;
    default:
        debug_early_boot_message("?\n");
        break;
    }

    gFDT = args->arch_args.fdt;

    return B_OK;
}

status_t
arch_platform_init_post_vm(struct kernel_args *kernelArgs)
{
    // TODO: Implement platform-specific initialization after VM setup
    return B_OK;
}

status_t
arch_platform_init_post_thread(struct kernel_args *kernelArgs)
{
    return B_OK;
}